package cn.mw.cmdb.template.entity;

import cn.mw.cmdb.template.entity.convert.MwTriggerConvertDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * 触发器
 */
@Getter
@Setter
@Schema(name = "TriggerDto", description = "触发器")
public class TriggerDto {

    @Schema(description = "触发器ID")
    private String triggerId;

    @Schema(description = "触发器名称")
    private String description;

    @Schema(description = "表达式")
    private String expression;

    @Schema(description = "严重性")
    private String priority;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "运营数据")
    private String opData;

    @Schema(description = "标记")
    private String tag;

    @Schema(description = "监控项ID")
    private String itemId;

    public void extractFrom(MwTriggerConvertDto triggerConvertDto){
        this.triggerId = triggerConvertDto.getTriggerid();
        this.description = triggerConvertDto.getDescription();
        this.expression = triggerConvertDto.getExpression();
        this.priority = triggerConvertDto.getPriority();
        this.status = triggerConvertDto.getStatus();
        this.opData = triggerConvertDto.getOpdata();
    }

}
